<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>City List</title>
<style>
table {
	font-family: arial, sans-serif;
	border-collapse: collapse;
	width: 100%;
}

td, th {
	border: 1px solid #ddd;
	text-align: left;
	padding: 8px;
}

tr:nth-child(even) {
	background-color: #ddd;
}
</style>

</head>
<body>

	<div style="width: 800px; margin-left:20px;">
	<a href="${pageContext.request.contextPath}/addcity">Add City</a>
		<table>
			<tr>
				<th>ID</th>
				<th>Name</th>
				<th>CountryCode</th>
				<th>District</th>
				<th>Population</th>
				<th>Edit</th>
				<th>Delete</th>
			</tr>
			<c:forEach var="city" items="${cities}">
				<tr>
					<td>${city.id}</td>
					<td>${city.name }</td>
					<td>${city.countrycode }</td>
					<td>${city.district }</td>
					<td>${city.population }</td>
					<td>Edit</td>
					<td>Delete</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>